package com.mt.api.modules.manager.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mt.api.modules.domain.InstoreDetail;
import com.mt.api.modules.manager.IInstoreDetailManager;
import com.mt.api.modules.mapper.InstoreDetailMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: plover
 * @Date: 2022-05-04
 * @Description:
 */
@Component
public class InstoreDetailManagerImpl extends ServiceImpl<InstoreDetailMapper, InstoreDetail> implements IInstoreDetailManager {

    @Override
    public List<InstoreDetail> getListByInstoreId(Integer instoreId) {
        LambdaQueryWrapper<InstoreDetail> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(InstoreDetail::getInstoreId, instoreId);
        return baseMapper.selectList(wrapper);
    }

    @Override
    public List<InstoreDetail> getListByInstoreIds(List<Integer> instoreIds) {
        LambdaQueryWrapper<InstoreDetail> wrapper = Wrappers.lambdaQuery();
        wrapper.in(InstoreDetail::getInstoreId, instoreIds);
        return baseMapper.selectList(wrapper);
    }

}
